package pe.gob.sunarp.entidad;

import java.io.Serializable;
import javax.persistence.*;
import java.util.Set;


/**
 * The persistent class for the USR_CONVENIO database table.
 * 
 */
@Entity
@Table(name="USR_CONVENIO")
public class UsrConvenio implements Serializable {
	private static final long serialVersionUID = 1L;
	private UsrConvenioPK id;
	private String estado;
	private Convenio convenio;
	private Set<UsrConvenioPermiso> usrConvenioPermisos;

    public UsrConvenio() {
    }


	@EmbeddedId
	public UsrConvenioPK getId() {
		return this.id;
	}

	public void setId(UsrConvenioPK id) {
		this.id = id;
	}
	

	@Column(length=1)
	public String getEstado() {
		return this.estado;
	}

	public void setEstado(String estado) {
		this.estado = estado;
	}


	//bi-directional many-to-one association to Convenio
    @ManyToOne
	@JoinColumn(name="COD_CONVENIO", nullable=false, insertable=false, updatable=false)
	public Convenio getConvenio() {
		return this.convenio;
	}

	public void setConvenio(Convenio convenio) {
		this.convenio = convenio;
	}
	

	//bi-directional many-to-one association to UsrConvenioPermiso
	@OneToMany(mappedBy="usrConvenio")
	public Set<UsrConvenioPermiso> getUsrConvenioPermisos() {
		return this.usrConvenioPermisos;
	}

	public void setUsrConvenioPermisos(Set<UsrConvenioPermiso> usrConvenioPermisos) {
		this.usrConvenioPermisos = usrConvenioPermisos;
	}
	
}